<template>
    <el-card shadow="never">
        <template #header>
            <el-alert effect="dark" :closable="false">管理员可以查看自己所拥有的权限的所有管理员的日志</el-alert>
        </template>
        <yun-table
                :columns="columns"
                toolbar="refresh,del"
                :extend="extend">
        </yun-table>
    </el-card>
</template>
<script>
    import table from "@components/Table.js";
    export default {
        components: {'YunTable':table},
        data:{
            extend:{
                index_url: 'auth/adminlog/index',
                del_url: 'auth/adminlog/del',
                detail_url: 'auth/adminlog/detail',
            },
            columns:[
                {checkbox: true},
                {field: 'id',title:'ID',width:80,operate:false},
                {field: 'username', title: __('用户名'),operate:'='},
                {field: 'title', title: __('标题'), operate:'='},
                {field: 'controller', title: __('控制器'), operate:'='},
                {field: 'action', title: __('方法'), operate:'like'},
                {field: 'url', title: __('访问链接'),operate:'like'},
                {field: 'ip', title: __('IP'),width:140},
                {field: 'createtime', title: __('创建时间'),sortable: true,width:150,operate:false},
                {
                    field: 'operate',
                    fixed: 'right',
                    title: __('操作'),
                    width:140,
                    action:{
                        detail:{
                            tooltip:false,
                            type:'primary',
                            icon:'fa fa-list',
                            text:'详情',
                            method:'showDetail'
                        },
                        del:true
                    }
                }
            ],
            detail:[]
        },
        methods: {
            showDetail:function (rows){
                Yunqi.api.open({
                    title:'详情',
                    height:450,
                    width:900,
                    icon:'fa fa-list',
                    url:this.extend.detail_url+'?ids='+rows.id
                });
            }
        }
    }
</script>
<style>

</style>
